﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using HZ.MBSM.DBUtility;

public partial class Supervise_HospitalInfo : System.Web.UI.Page
{
    private Int64 AccountId;
    protected void Page_Load(object sender, EventArgs e)
    {

        if (!this.IsPostBack)
        {
            AccountId = Convert.ToInt64(Request.QueryString["id"]);
            HZ.MBSM.DBUtility.Db db = new HZ.MBSM.DBUtility.Db(false);
            Grove.ORM.ObjectOperator oo = db.GetObjectOperator();
            HZ.MBSM.Model.Hospital Hospital = (HZ.MBSM.Model.Hospital)oo.Retrieve(typeof(HZ.MBSM.Model.Hospital), AccountId);
            HZ.MBSM.Model.Area Area = (HZ.MBSM.Model.Area)oo.Retrieve(typeof(HZ.MBSM.Model.Area), Hospital.AreaId);

            if (Hospital != null)
            {
                if (Area != null)
                    this.Label1.Text = "<input disabled  type='text' name='AreaName' style='width: 110px' value='" + Area.AreaName + "' /><input type='text' name='AreaId'   style='display:none; width: 64px;' value='" + Hospital.AreaId + "'>";
                else
                    this.Label1.Text = "<input  disabled type='text' name='AreaName' style='width: 110px' /><input type='text' name='AreaId' style='display:none; width: 64px;' >";
                txtUserCode.Text = SysFun.ToTrim(Hospital.UserCode);
                txtUserCode.Enabled = false;
                HospitalName.Text = Hospital.HospitalName;
                HospitalName.Enabled = false;
                IsOldLeader.SelectedValue = SysFun.BoolToByte(Hospital.IsOldLeader).ToString();
                Lawer.Text = Hospital.Lawer;
                PostCode.Text = Hospital.PostCode;
                RegistDate.Text = Hospital.RegistDate.ToShortDateString();
                RegistDate.Visible = false;
                Telephone.Text = Hospital.Telephone;
                Sort.SelectedValue = Hospital.Sort;
                Address.Text = Hospital.Address;
                Textemail.Text = Hospital.Email;
                distinction.SelectedValue = Hospital.distinction;
            }

            oo.Dispose();
            db.Close();
        }
    }
}
